<%= form_for(@item, :html=> {:class => "form"}) do |f| %>
    <% if @item.errors.any? %>
        <div id="error_explanation">
            <h2><%= pluralize(@item.errors.count, "error") %> prohibited this cliente from being saved:</h2>

            <ul>
                <% @item.errors.full_messages.each do |msg| %>
                    <li><%= msg %></li>
                <% end %>
            </ul>
        </div>
    <% end %>

    <div class="formulario">
        <div class="form-titulo">
            <h2>Nuevo <strong>Item</strong></h2>

            <div class="form-buttons">
                <a class="button-adicional" id="dropdownMenu2" data-toggle="dropdown" rel="tooltip" data-placement="top" data-original-title="Mas Acciones">
                    <i class="fa fa-cog"></i>
                </a>
                <a class="button-adicional" href="#" data-toggle="collapse" data-target="#form-data" rel="tooltip" data-placement="top" data-original-title="Colapsar">
                    <i class="fa fa-chevron-down"></i>
                </a>
                <a class="button-adicional" href="#" rel="tooltip" data-placement="top" data-original-title="Ayuda">
                    <i class="fa fa-question-circle"></i>
                </a>

                <%= link_to items_path, class: "btn btn-primary btn-xs" do %>
                    <i class="fa fa-arrow-left"></i> Regresar
                <% end %>
            </div>
        </div>

        <div class="in form-body" id="form-data">
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group campo-data">
                        <label>Tipo</label>
                        <%= f.collection_select :TipoItem_id, @tipos_item, :id , :Descripcion, {}, {:class => "form-control input-sm", :tabindex => "1"} %>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group campo-data">
                        <label>Nombre/Numero de Item</label>
                        <%= f.text_field :Nombre, :class => "form-control input-sm", :tabindex => "2" %>
                    </div>
                </div>

                <div class="col-sm-4">
                    <div class="form-group campo-data">
                        <label>SubItem de</label>
                        <%= f.collection_select :SubItem, @items, :id , :Nombre, {}, {:class => "form-control input-sm", :tabindex => "3"} %>
                    </div>
                </div>

                <div class="col-sm-4">
                    <div class="form-group campo-data">
                        <label>Número Piezas Fabricante</label>
                        <%= f.text_field :NoPiezaFabricante, :class => "form-control", :tabindex => "4" %>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group campo-data">
                        <label>Unidad de Medida (U/M)</label>
                        <%= f.collection_select :UnidadMedida_id, @unidades_medida, :id , :Descripcion, {}, {:class => "form-control input-sm", :tabindex => "5"} %>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group campo-data">
                        <label>Descripción de las Operaciones de Compra</label>
                        <%= f.text_area :DescripcionCompras, :class => "form-control txt-area", :tabindex => "6" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Costo</label>
                        <%= f.text_field :CostoCompras, :class => "form-control", :tabindex => "8" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Proveedor Preferido</label>
                        <%=  f.collection_select :Proveedor_id, @proveedores, :id , :NombreRazon, {}, {:class => "form-control input-sm", :tabindex => "10"} %>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group campo-data">
                        <label>Descripción de las Operaciones de Venta</label>
                        <%= f.text_area :DescripcionVentas, :class => "form-control txt-area", :tabindex => "7" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Precio</label>
                        <%= f.text_field :PrecioVenta, :class => "form-control", :tabindex => "9" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Cuenta Activo</label>
                        <%= f.text_field :CuentaActivo, :class => "form-control", :tabindex => "11" %>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-3">
                    <div class="form-group campo-data">
                        <label>Punto de Pedido</label>
                        <%= f.text_field :PuntoPedido, :class => "form-control", :tabindex => "12" %>
                    </div>
                </div>

                <div class="col-sm-3">
                    <div class="form-group campo-data">
                        <label>A Disposición</label>
                        <%= f.text_field :ADisposicion, :class => "form-control", :tabindex => "13" %>
                    </div>
                </div>

                <div class="col-sm-3">
                    <div class="form-group campo-data">
                        <label>Valor Total</label>
                        <%= f.text_field :Total, :class => "form-control", :tabindex => "14" %>
                    </div>
                </div>

                <div class="col-sm-3">
                    <div class="form-group campo-data">
                        <label>Apartir de</label>
                        <%= f.text_field :APartirDe, :class => "form-control", :tabindex => "15" %>
                    </div>
                </div>
            </div>
          
            <div class="row">
                <div class="col-sm-3">
                    <div class="form-group campo-data">
                        <label>Fraccion Arancelaria</label>
                        <%= f.text_field :FraccionArancelaria, :class => "form-control", :tabindex => "16" %>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="formulario-footer">
        <%= f.submit "Guardar", :class => "btn btn-primary", :tabindex => "17" %>
        <%= link_to "Cancelar", items_path, :class => "btn btn-default", :tabindex => "18" %>
    </div>
<% end %>
